

import java.util.ArrayList;

import logic.MySQLconnection;
import Entities.RequestEntity;
import fit.ActionFixture;
import gui.AcademicFrame;
import gui.ServerGui;

public class Complete extends ActionFixture
{
	ServerGui server;
	AcademicFrame client;
	MySQLconnection sql;
	String reqID;
	String newStatus = "998";
	public void setupfixture()
	{
		server = new ServerGui();
		server.fakeServer(5555, "mysql://localhost/test", "root", "Braude");
		server.myLog.setVisible(false);
		client = new AcademicFrame("Localhost",5555);
		
	}

	public void setRequestID (String requestID)
	{
		reqID = requestID;
	}
 
	public boolean complete()
	{
		
		ArrayList<Object> answer = new ArrayList<Object>();
		ArrayList<Object> question = new ArrayList<Object>();
		question.add("Complete");
		question.add(reqID);
		question.add(newStatus);
		client.myclient.sendMessageToServer(question);
		while (client.answer==null);
		answer = client.answer;
		client.answer=null;
		if(answer.get(1).equals("Valid"))
			return true;
		else
			return false;
	}
}
